from flask import Blueprint
from app.utils.response_format import resp_json
from app.tasks.tasks1 import task1
from app.middleware.middleware import login_user_data


# 创建蓝图对象
index_blu = Blueprint('index_blu', __name__)


@index_blu.route('/test', methods=['GET'])
@login_user_data
def test_redis():
    return resp_json(data='ok')


@index_blu.route('/', methods=['GET'])
@login_user_data
def index():
    task1.delay()
    return resp_json(data='ok')
